//set数据结构
const s = new Set();
s.add(1).add(2).add(3).add(2);
console.log(s);
s.forEach((i) => console.log(i));
for (let i of s) {
  console.log(i);
}
console.log(s.size); //3
console.log(s.has(5)); //false
console.log(s.delete(2)); //true
s.clear();
let arr = [1, 2, 3, 4, 2, 4, 1];
// const result = Array.from(new Set(arr));
const result = [...new Set(arr)];
console.log(result);
